﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;

namespace CommomFunctions
{
    public class Controls
    {
        protected static Button[] btns = { };
        protected static Trace txtTrace = new Trace();
        protected Grid gd = new Grid();

        protected Grid actualGrid
        {
            get { return this.gd; }
            set { this.gd = value; }
        }

        protected void createTrace(int coluna, int colunaSpan, int linha, int linhaSpan, Thickness margem, int altura, int larguraMaxima)
        {
            txtTrace.criaTrace(gd, coluna, colunaSpan, linha, linhaSpan, margem, altura, larguraMaxima);
        }

        protected void createLogo(int linha, int linhaSpan, Thickness margem)
        {
            Image logoInf = new Image();

            Imagens.createLogoInf(logoInf, margem);
            gd.Children.Add(logoInf);
            Grid.SetRow(logoInf, linha);
            Grid.SetRowSpan(logoInf, linhaSpan);
        }
        
        protected void createTitle(string title, int coluna, int colunaSpan, Thickness margem)
        {
            Label titulo = new Label();

            Titulo.setaPropriedadesTitulo(titulo, title);
            titulo.Margin = margem;
            gd.Children.Add(titulo);
            Grid.SetColumn(titulo, coluna);
            Grid.SetColumnSpan(titulo, colunaSpan);
            Grid.SetRow(titulo, 0);
        }

        public void writeTrace(String txt, Brush color)
        {
            txtTrace.writeTrace(txt, color);
        }

        public void btnsToEnableDisable(Button[] btn)
        {
            btns = btn;
        }

        public static void setAllImagesHidden()
        {
            Imagens.setAllImagesHidden();
        }
    
    }
}
